package com.amos.client.controller;

import com.amos.client.config.AppConfig;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * PROJECT: config-client
 * DESCRIPTION: note
 *
 * @author Daoyuan
 * @date 2019/2/28
 */
@RestController
public class ClientController {

    @Resource
    private AppConfig appConfig;

    @RequestMapping("/from")
    public String from() {
        return appConfig.getAppFrom() + " >>>>>>><<<<<<< " + appConfig.getHelloMessage();
    }

    @RequestMapping("/from2")
    public String from2() {
        String appFrom = appConfig.getEnv().getProperty("HELLO_MESSAGE", "undefined");
        String helloMessage = appConfig.getEnv().getProperty("APP_MESSAGE", "undefined");
        return appFrom + " >>>>>>><<<<<<< " + helloMessage;
    }

}
